defense pattern